<?php if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) { die(); }
extract(itx_get_option('front'));?>

<div id="itx-front">
<h3>Front page design</h3>
<hr/>

<h4>Layout</h4>
<p>These settings will affect all index page, categories pages, archives page, etc wich not a single post or single page.</p>
<p>Please note that Featured item only shows in front page (page one). Other pages (page two or more) not showing featured item.</p>

<table class="form-table">
<tr><th>Display type:</th><td>
	<?php
	itx_form_radios(array('traditional'=>'Traditional','excerpt'=>'Excerpts','fe'=>'Featured and Excerpts', 'fl'=>'Featured and Line'),'front[type]',$type);
	?>
</td></tr>

<tr><th>Arrange Excerpt by:<br /><small>If display type B or C selected</small></th><td>
	<select name="<?php echo get_template();?>_front[column]" id="ifront">
		<?php
		itx_form_options(array(1=>'One Column',2=>'Two Columns',3=>'Three Columns',4=>'Four Columns',5=>'Five Columns',6=>'Six Columns',7=>'Seven Columns',8=>'Eight Columns'), $column);
		?>
	</select>
</td></tr>

<tr><th>Limit Featured text</th><td>
<input type="text" name="<?php echo get_template();?>_front[featuredlim]" value="<?php echo $featuredlim; ?>" class="small-text" /> words</td></tr>

<tr><th>Limit Excerpts text</th><td>
<input type="text" name="<?php echo get_template();?>_front[excerptlim]" value="<?php echo $excerptlim; ?>" class="small-text" /> words</td></tr>
</table>
<hr/>

<h4>Read More Text</h4>
<table class="form-table"><tr><th>Text to replace the default '[...]' string in excerpt mode if the full text is cropped.</th>
<td><input type="text" name="<?php echo get_template();?>_front[excerpt_more]" value="<?php echo $excerpt_more; ?>" /></td>
</tr></table>
<hr />

<h4>Front Page Meta</h4>
Meta info to show in each post in the frontpage (in excerpts and line posts).
<input type="hidden" name="<?php echo get_template();?>_front[meta][opt]" value="1" />
<?php
$i=0;
foreach (itx_setting('meta') as $k => $v ){
	if (!empty($v)){
		if (is_array($v)){
			echo "<table class='form-table'><tr><th>Show in the $k</th><td>";
			itx_form_radios(array('None')+$v,"front[meta][$i]",$meta[$i],false);
			echo '</td></tr></table>';
		} else{
			$checked=(isset($meta[$i])&&$meta[$i]==$k)?'checked="checked"':'';
			echo '<table class="form-table"><tr><th>Show '.$v.'</th>
			<td><input type="checkbox" name="'.get_template().'_front[meta]['.$i.']" value="'.$k.'" '.$checked.' /></td></tr></table>';
		}
	}
	$i++;
}
?>
<hr />
<h4>Posts Thumbnails/Featured Images</h4>
<p>Thumbnails/images  on index page, categories pages, archive pages, etc. Not including thumbnails on single post or single page. </p>
<p>In WordPress 2.9 and later, Post Thumbnail/Featured Images are croped to fit these values. Both are set via post-thumbnail (wp 2.9) or featured image (wp 3.0) feature using same image.</p>
<p>In WordPress prior to 2.9 you can set post-thumbnai using Custom field. The name is <strong>thumb</strong>. You can enter the attachment-ID if the image or the URL of the image.
    If attachment-ID is set in <strong>thumb</strong> custom field, the system will use the attachment image and resize them to fit these sizes set below using CSS.
    If <strong>thumb</strong> custom field value is an URL, the system will use timthumb to crop the image to fit these sizes set below.
</p>
<p>More about Attachment in WordPress: <a href="http://codex.wordpress.org/Using_Image_and_File_Attachments">Attachments</a>
More about Custom Field in WordPress: <a href="http://codex.wordpress.org/Custom_Fields">Custom Fields</a></p>

<table  class="form-table"><tr><th>Featured/Bigger size</th><td>
	Width <input type="text" name="<?php echo get_template();?>_front[featuredx]" value="<?php echo $featuredx; ?>" class="small-text" maxlength="3" />
	Height <input type="text" name="<?php echo get_template();?>_front[featuredy]" value="<?php echo $featuredy; ?>" class="small-text" maxlength="3" /><br />
</td></tr>

<tr><th>Thumbnail size</th><td>
	Width <input type="text" name="<?php echo get_template();?>_front[thumbx]" value="<?php echo $thumbx; ?>" class="small-text" maxlength="3" />
	Height <input type="text" name="<?php echo get_template();?>_front[thumby]" value="<?php echo $thumby; ?>" class="small-text" maxlength="3" /> <br />
	Post thumbnails are croped to fit these values.

<tr><th>If no Post Thumbnail/Featured Image Set in a post </th><td>
	<?php
	itx_form_radios(array(0=>"Don't find any other thumbnail/image",'1'=>'Try to find a thumbnail/image in the post'), 'front[catch]', $catch);
	?>
</td></tr>

<tr><th>If no Thumbnail/Image Found in a post </th><td>
	<?php
    itx_form_radios(array(0=>"Don't display any box",1=>'Display a box with default pattern',2=>'Display custom image:<div class="radiopad">Featured size: <input type="text" name="'.get_template().'_front[fnotimg]" value="'.$fnotimg.'" class="regular-text"><br />Thumbnail size: <input type="text" name="'.get_template().'_front[notimg]" value="'.$notimg.'" class="regular-text"><br />Enter the url here. Don\'t forget the http://</div>'), 'front[not]', $not);
	?>
</td></tr></table>
<div class="clear"></div>
<?php do_action('itx_admin_front');?>
<button type="submit" name="<?php echo get_template();?>_reset" class="button-secondary"  value="front" onclick="if (!confirm('Do you want to reset Front Page Options to Default?')) return false;">Reset to default Front Page Options</button>
</div>